/** 
Copyright (c) 2010, Sheikh Abdul Wahid Ahmed
Details @ http://extremecodeworld.codeplex.com/license
**/

using System;
using System.IO;
using System.Threading;
namespace EXtremecode.Utils
{
	/// <summary>
	/// Summary description for Mics.
	/// </summary>
	public class ThreadUtil
	{
		private static ThreadUtil singleton=new ThreadUtil();
		public static ThreadUtil Instance
		{
			get
			{
				if(singleton==null)
				{
					singleton=new ThreadUtil();
				}
				return singleton;
			}
		}
		public object this[string name]
		{
			get
			{
				LocalDataStoreSlot slot=Thread.GetNamedDataSlot(name);
				return Thread.GetData(slot);
			}
			set
			{
				LocalDataStoreSlot slot=Thread.GetNamedDataSlot(name);
				Thread.SetData(slot,value);
			}
		}
	}
		
}

